#include "dataanalyse.h"
#include "../util/Constant.h"

dataanalyse::dataanalyse(QObject *parent) : QObject(parent)
{
     //实例化数据分析类
     ana = new Analyse() ;
}

///
/// \brief dataanalyse::PROCYingguangshuaijian 计算衰减曲线
/// \param singleYingguang 单孔单通道荧光值
/// \return
///
QList<double> dataanalyse::PROCYingguangshuaijian(QList<int> singleYingguang, int shuaijianType){
    int len = singleYingguang.count();
    double yingFb[len] ;
    double yingFa[len] ;
    double yingFn[len] ;
    double yingXF[len];
    double Flb[len];
    int ying[len];
    double ying1[len];
    QList<double> res;
    double yingBAvg, yingAAvg, yingNAvg;

    for(int i=0;i<len;i++)
    {
        ying[i] = singleYingguang[i];
        ying1[i] = ying[i];
    }
    ana->p = ying;

    ana->leh = len;


//    qDebug() << "yingbase" << (sizeof(ying1)/sizeof(double));
//    for(const double &yinl : ying1){
//        qDebug() << "yingl" << yinl;
//    }

    if(shuaijianType == 0){
        yingBAvg = ana->yingB(ying,yingFb,len) ;
        yingAAvg = ana->yingA(yingFb,yingFa) ;
        yingNAvg = ana->yingN(yingFn, yingAAvg , yingBAvg );

        ana->yingX(yingFn,yingXF,yingNAvg);
        ana->yingJ(yingXF,Flb);
        for(int i=0;i<len ;i++)
        {
           res.append(Flb[i]);
        }
    }else if(shuaijianType == 1){
        ana->yingBase(Flb);
        for(int i=0;i<len ;i++)
        {
           res.append(Flb[i]);
        }

    }

    return res;
}

///
/// \brief dataanalyse::PROCYingguanglvbo 滤波计算（必须开启）
/// \param singleYingguang double型list（单孔单通道）
/// \return
///
QList<double> dataanalyse::PROCYingguanglvbo(QList<double> singleYingguang, int lvboType){
    QList<double> res;
    int len = singleYingguang.count();
    double Flb[len];
    double Flc[len];
    double ac ;
    double maxLvbo;
//    LOG << lvboType;
    for (int i=0;i<len;i++) {
        Flb[i] = singleYingguang[i];
    }

    if(lvboType == 0){
        double pop[5][5] = {   {0.886,0.257,-0.086,-0.143,0.086},
                                {0.257,0.371,0.343,0.171,-0.143},
                                {-0.086,0.343,0.486,0.343,-0.086},
                                 {-0.143,0.171,0.343,0.371,0.257},
                                {0.086,-0.143,-0.086,0.257,0.886}};
        ac = ana->IIR_Init(Flc,Flb,pop);
    }else if(lvboType == 1){
        double pop[5][5] = {   {0.986,0.057,-0.086,0.057,-0.014},
                               {0.057,0.771,0.343,-0.228,0.057},
                               {-0.086,0.343,0.486,0.343,-0.086},
                               {0.057,-0.229,0.343,0.771,0.057},
                               {-0.014,0.057,-0.086,0.057,0.986}};
        ac = ana->IIR_Init(Flc,Flb,pop);
    } else if(lvboType == 2) {
        double pop[7][7] = {   {0.761,0.357,0.071,-0.095,-0.107,-0.071,0.119},
                               {0.357,0.286,0.214,0.143,0.0179,0,-0.071},
                               {0.071,0.214,0.286,0.286,0.125,0.071,-0.143},
                               {-0.095,0.143,0.286,0.333,0.214,0.143,-0.095},
                               {-0.143,0.071,0.214,0.286,0.286,0.214,0.071},
                               {-0.071,0,0.071,0.143,0.339,0.286,0.357},
                               {0.119,-0.071,-0.143,-0.095,0.125,0.357,0.762}};
        ac = ana->II_Seven(Flc,Flb,pop);
    } else if (lvboType == 3) {
        // move window
    }



    //ac = ana->IIR_Init(Flc,Flb,pop);

    ana->maxLvbo = Flc[0];
    for(int i=0;i<len ;i++)
    {
        if(Flc[i]>=ana->maxLvbo)
        {
            ana->maxLvbo = Flc[i] ;

        }
        res.append(Flc[i]);

    }
     return res;
}

///
/// \brief dataanalyse::PROCYingguangkuozeng（阈值CT值计算）
/// \param singleYingguang
/// \return
///
//QList<double> dataanalyse::PROCYingguangkuozeng(QList<double> singleYingguang){
//    QList<double> res;
//    int len = singleYingguang.count();
//    double Fa[len] ,Fb[len],Fc[len];
//    double E, K,S,Ct;
//    double maxF;
//    int maxS ;
//    double Flc[len];

//    for (int i=0;i<len;i++) {
//        Flc[i] = singleYingguang[i];
//    }

//    //计算基线3-15个循环
//    //    ana->yingJAvg = ana->lvboAVG(Flc);
//    for(int i=0;i<len;i++)
//    {
//        Fa[i] = ana->yingJAvg ;
//    }
//    //计算扩增效率
//    E = ana->K_slope(Flc,Fa,len,5);

//    //计算扩增斜率
//    K = ana->yingK(E) ;


//    //ana->start = ui->lineEdit_2->text().toInt();
//    //ana->end = ui->lineEdit_4->text().toInt();

//    //计算阈值
//    S = ana->xunhuanS(Flc,ana->start,ana->end);

//    for(int i=0;i<len;i++)
//    {
//        Fb[i] =S ;
//    }


//    for(int i = 0; i < len; i++){
//        res.append(Flc[i]);
//    }
//    qDebug()<< "扩增数据"<<res;
//    qDebug()<< "阈值：" << S;;

//    maxF = ana->yingFDM(Flc,Fc) ;
//    maxF = Fc[0];
//    for(int i=0 ;i<(len -1);i++)
//    {
//        if(Fc[i]>=maxF)
//        {
//            maxF = Fc[i] ;
//            maxS = i+1 ;
//        }
//    }

//    //三种计算方法
//    Ct = ana->yingCTSigmoid(S,ana->yingJAvg,K,ana->maxLvbo);
//    //Ct = ana->yingCTJiao(Flc,S,ana->end);
//    //Ct = ana->yingCT(K,maxS,ana->maxLvbo,S);
//    qDebug() << "Ct值:" <<Ct;
//    return res;
//}

///
/// \brief dataanalyse::PROCyuzhi 封装阈值CT值计算方法
/// \param singleYingguang
/// \param CTtype 0=sigmoid，1=交叉，2=普通
/// \param start 默认3
/// \param end   默认15
/// \param yuzhi double型
/// \return
///
QList<QList<double>> dataanalyse::PROCyuzhi(QList<double> singleYingguang, int CTtype, QHash<QString, int> baseline={}, double yuzhi=0.0, int NL=0, int sigmodType=0){
    QList<double> res,res1;
    QList<QList<double>> allres;
    int start = baseline["start"];
    int end = baseline["end"];
    int len = singleYingguang.count();
    double Fa[len] ,Fb[len],Fc[len];
    double E, K,S,Ct;
    double maxF;
    int maxS ;
    double Flc[len], Fn[len], normalizeN[len];
    double yingJAvg;
    for (int i=0;i<len;i++) {
        Flc[i] = singleYingguang[i];
    }


    ana->start = start;
    ana->end = end;

    //计算扩增效率
    E = ana->K_slope(Flc,Fa,len,5);

    //计算扩增斜率
    K = ana->yingK(E) ;

    maxF = ana->yingFDM(Flc,Fc) ;
    maxF = Fc[0];
    for(int i=0 ;i<(len -1);i++)
    {
        if(Fc[i]>=maxF)
        {
            maxF = Fc[i] ;
            ana->c0 = i+1 ;
        }
    }

    qDebug() << "sigmodType" << sigmodType;
    LOG << "ewfhwsef" << len;
    double SDM[len];
    int Csdm = ana->yingSDM(Fc,SDM);
    if(sigmodType==1){

        qDebug() << "sigmodDelta";

        ana->sigmodDelta(Flc,K,Fn, 1.1); //拟合曲线FN是拟合后的曲线
    }else if(sigmodType==0){

        qDebug() << "sigmod";

        ana->sigmod(Flc,K,Fn);
    }

    QList<double> fnl;
    for(int i = 0 ; i < len; i++){
        fnl.append(Fn[i]);
    }

    qDebug() << "FNL";

    for(int i=0;i<len;i++){
        if(NL == 0){
            res1.append(Fn[i]);
        }else if(NL == 1){
            ana->normalizeN(Fn,normalizeN);
            res1.append(normalizeN[i]);
        }

    }

    for(int i=0;i<len;i++)
    {
      Fa[i] = ana->yingJAvg ;
    }

    E = ana->eff(Fn,Fa,ana->leh,5); //根据拟合数据重新计算效率和斜率
    K = ana->yingK(E) ;

    //计算阈值

    qDebug() << "anastartend" << ana->start << ana->end << start << end;
    S = ana->xunhuanS(Fn,ana->start,ana->end);
    for(int i=0;i<len;i++)
    {
        Fb[i] =S ;
    }

    if(yuzhi != 0.0){
        S = yuzhi;
        //三种计算方法
        if(CTtype==0){
            Ct = ana->yingCTSigmoid(S,ana->yingJAvg,K,ana->maxLvbo);
        }else if(CTtype==1){
             Ct = ana->yingCTJiao(Fn,S,end);
        }else if(CTtype==2){
            Ct = ana->yingCT(K,ana->c0,ana->maxLvbo,S);
        }
    }else {
        //三种计算方法
        if(CTtype==0){
            Ct = ana->yingCTSigmoid(S,yingJAvg,K,ana->maxLvbo);
        }else if(CTtype==1){
             Ct = ana->yingCTJiao(Fn,S,end);
        }else if(CTtype==2){
            Ct = ana->yingCT(K,maxS,ana->maxLvbo,S);
        }
    }

    /* 如果ct值 <= 0 或 >= 循环数，则不合法 */
    if(Ct <= 0.0 || Ct >= (double)len){
        Ct = (0.0)/(0.0); // 赋值为nan
    }

    res.append(S);
    res.append(Ct);
    allres.append(res1);
    allres.append(res);
    return allres;
}
///
/// \brief dataanalyse::PROCshujufenxidan 单孔单通道数据分析方法封装
/// \param singleYingguang 传入一个单孔单通道循环结果的数组
/// \param shuaijian 衰减是否开启，1开0关
/// \param CtType 0=sigmoid，1=交叉，2=普通
/// \param start 默认3
/// \param end   默认15
/// \param yuzhi double型
/// \return
///
QList<double> dataanalyse::PROCshujufenxidan(QList<int> singleYingguang,int shuaijian = 1,int CtType=0, QHash<QString, int> baseline = {}, double yuzhi=0.0, int shuaijianType=0, int lvboType=0, int NL=0, int sigmodType=0){
    QList<int> inputdata;
    QList<double> shuaijiandata;
    QList<double> lvbodata;
    QList<QList<double>> kuozengdata;
    QList<double> ctres;
    QList<double> result;
    int start = baseline["start"];
    int end = baseline["end"];

    inputdata = singleYingguang;
    if(shuaijian == 1){
        shuaijiandata = PROCYingguangshuaijian(inputdata, shuaijianType);
    }else if(shuaijian == 0){
        for (int i = 0; i < inputdata.count(); i++) {
            shuaijiandata.append(inputdata[i]);
        }
    }
    lvbodata = PROCYingguanglvbo(shuaijiandata, lvboType);
    kuozengdata= PROCyuzhi(lvbodata,CtType,baseline, yuzhi, NL, sigmodType);
    ctres = kuozengdata[1];
    qDebug()<<"阈值："<<ctres[0];
    qDebug()<<"CT："<<ctres[1];
    result.append(ctres[0]);
    result.append(ctres[1]);
    for (int i=0;i<kuozengdata[0].count();i++) {
        result.append(kuozengdata[0][i]);
    }
    return result;
}

///
/// \brief dataanalyse::PROCshengcheng 该方法为测试方法，模拟生成原始荧光数据
/// \param len
/// \return
///

QList<QList<QHash<QString, QString>>> dataanalyse::PROCshengcheng(int len=41){
    QList<QList<QHash<QString, QString>>> res;
    QList<QHash<QString, QString>> tmp;
    QList<int> singleYingguang = {3442, 3395, 3360, 3341, 3339, 3324, 3328, 3318, 3328, 3307, 3318, 3318, 3303, 3317, 3325, 3324, 3305, 3304, 3303, 3312, 3307, 3300, 3319, 3334, 3354, 3359, 3355, 3338, 3356, 3345, 3340, 3337, 3331, 3325, 3334, 3334, 3339, 3345, 3380, 3377};
    for (int i=0; i<len; i++)
    {
        QString inputdata = QString::number(singleYingguang[i]);
        //只设置32个荧光孔位信息
        for (int row=0; row<32; row++)
        {
            QHash<QString,QString> stage_data;
            stage_data.insert("4",inputdata);
            stage_data.insert("3",inputdata);
            stage_data.insert("2",inputdata);
            stage_data.insert("1",inputdata);
            tmp.append(stage_data);
        }
        res.append(tmp);

    }
//    qDebug()<<"荧光原始数据所有孔位："<<res<<res.count();
    return res;
}

///
/// \brief dataanalyse::PROCchaijie 拆分原始荧光数据方法
/// \param data 传入原始荧光数据格式
/// \return
///
QList<QList<QHash<int, QHash<int, int>>>> dataanalyse::PROCchaijie(QList<QList<QHash<QString, QString>>> data){
    QList<QHash<QString, QString>> yingGuangData;
    QHash<int, int> tmpdata1, tmpdata2, tmpdata3, tmpdata4;
    QHash<int, QHash<int, int>> tongdao1, tongdao2, tongdao3, tongdao4;
    QList<QHash<int, QHash<int, int>>> res1,res2,res3,res4;
    QList<QList<QHash<int, QHash<int, int>>>> resdata;
    int k1,k2,k3,k4;
    //外层循环数
    for(int i = 0; i < data.count(); i++){
        yingGuangData = data[i];
        //内层孔位
        for(int j = 0; j < yingGuangData.count(); j++){
           int num = j % 32;
           //取出荧光值
           k1 = yingGuangData[j]["1"].toInt();
           k2 = yingGuangData[j]["2"].toInt();
           k3 = yingGuangData[j]["3"].toInt();
           k4 = yingGuangData[j]["4"].toInt();
           //插入新数据结构
           tmpdata1.insert(i+1,k1);
           tmpdata2.insert(i+1,k2);
           tmpdata3.insert(i+1,k3);
           tmpdata4.insert(i+1,k4);
           tongdao1.insert(num+1,tmpdata1);
           tongdao2.insert(num+1,tmpdata2);
           tongdao3.insert(num+1,tmpdata3);
           tongdao4.insert(num+1,tmpdata4);
       }
        //按循环数存放
        res1.append(tongdao1);
        tmpdata1.clear();
        tongdao1.clear();
        res2.append(tongdao2);
        tmpdata2.clear();
        tongdao2.clear();
        res3.append(tongdao3);
        tmpdata3.clear();
        tongdao3.clear();
        res4.append(tongdao4);
        tmpdata4.clear();
        tongdao4.clear();
    }
    //形成大的list进入数据分析
    resdata.append(res1);
    resdata.append(res2);
    resdata.append(res3);
    resdata.append(res4);
    return resdata;
}

QList<QHash<int, QList<double>>> dataanalyse::PROCparseData(QList<QList<QHash<int, QHash<int, int>>>> data,int shuaijian = 1,int CtType=0,QList<QHash<QString, int>> baseline = {}, double yuzhi1 = 0.0, double yuzhi2 = 0.0, double yuzhi3 = 0.0, double yuzhi4 = 0.0
        ,int shuaijianType=0, int lvboType=0, int NL=0, int sigmodeType=0){
    QList<QHash<int, QList<double>>> res;
    QList<QList<int>> tmpres;
    QHash<int, int> xunhuan1;
    QHash<int, int> xunhuan2;
    QHash<int, int> xunhuan3;
    QHash<int, int> xunhuan4;
    QHash<int, QList<int>> parsedata1;
    QHash<int, QList<int>> parsedata2;
    QHash<int, QList<int>> parsedata3;
    QHash<int, QList<int>> parsedata4;
    QList<QHash<int, QHash<int, int>>> res1, res2, res3, res4;
    res1 = data[0];
    res2 = data[1];
    res3 = data[2];
    res4 = data[3];
    QHash<int, int> tmp1,tmp2,tmp3,tmp4;
    int num1, num2, num3, num4;
    QList<int> tongdao1,tongdao2,tongdao3,tongdao4;
    QList<QList<int>> kongwei1,kongwei2,kongwei3,kongwei4;
    /*拆分数据*/
    for (int i = 0; i < res1[0].count();i++) {
         for (int j=0;j<res1.count();j++) {
             tmp1 = res1[j][i+1];
             num1 = tmp1[j+1];
             tongdao1.append(num1);

             tmp2 = res2[j][i+1];
             num2 = tmp2[j+1];
             tongdao2.append(num2);

             tmp3 = res3[j][i+1];
             num3 = tmp3[j+1];
             tongdao3.append(num3);

             tmp4 = res4[j][i+1];
             num4 = tmp4[j+1];
             tongdao4.append(num4);
         }
         kongwei1.append(tongdao1);
         tongdao1.clear();

         kongwei2.append(tongdao2);
         tongdao2.clear();

         kongwei3.append(tongdao3);
         tongdao3.clear();

         kongwei4.append(tongdao4);
         tongdao4.clear();
    }

    QHash<int, QList<double>> tmpdata1;
    QHash<int, QList<double>> tmpdata2;
    QHash<int, QList<double>> tmpdata3;
    QHash<int, QList<double>> tmpdata4;

    QList<double> testdata1;
    QList<double> testdata2;
    QList<double> testdata3;
    QList<double> testdata4;



    //解析单孔单通道数据
    for (int j = 0; j< kongwei1.count();j++) {
        testdata1 = PROCshujufenxidan(kongwei1[j],shuaijian,CtType,baseline[0], yuzhi1, shuaijianType, lvboType, NL, sigmodeType);
        testdata2 = PROCshujufenxidan(kongwei2[j],shuaijian,CtType,baseline[1], yuzhi2, shuaijianType, lvboType, NL, sigmodeType);
        testdata3 = PROCshujufenxidan(kongwei3[j],shuaijian,CtType,baseline[2], yuzhi3, shuaijianType, lvboType, NL, sigmodeType);
        testdata4 = PROCshujufenxidan(kongwei4[j],shuaijian,CtType,baseline[3], yuzhi4, shuaijianType, lvboType, NL, sigmodeType);
        tmpdata1.insert(j+1,testdata1);
        tmpdata2.insert(j+1,testdata2);
        tmpdata3.insert(j+1,testdata3);
        tmpdata4.insert(j+1,testdata4);

    }
    res.append(tmpdata1);
    res.append(tmpdata2);
    res.append(tmpdata3);
    res.append(tmpdata4);
    return res;
}


std::tuple<QList<QList<QHash<QString, QString>>> ,QList<double>,QList<QHash<QString, QString>>> dataanalyse::PROCzuheData(QList<QHash<int, QList<double>>> data){
    QHash<int, QList<double>> tongdao1 = data[0];
    QHash<int, QList<double>> tongdao2 = data[1];
    QHash<int, QList<double>> tongdao3 = data[2];
    QHash<int, QList<double>> tongdao4 = data[3];
    QList<double> s1,s2,s3,s4,k1,k2,k3,k4;
    QHash<QString, QString> kongwei;
    QHash<QString, QString> kongweiyuzhi;
    QHash<QString, QString> kongweict;
    std::tuple<QList<QList<QHash<QString, QString>>> ,QList<double>,QList<QHash<QString, QString>>> zuhedata;
    QList<double> ct,yuzhi;
    QHash<QString, QString> yuzhidata;
    QList<QHash<QString, QString>> resyuzhi;
    QList<QHash<QString, QString>> platedata;
    QList<QList<QHash<QString, QString>>> resdata;
    QList<QList<QHash<QString, QString>>> res;
    int num = 0;


    QList<QHash<QString, QString>> p1;
    //外循环32个孔
    for (int i=0; i< 32;i++) {
        s1 = tongdao1[i+1];
        s2 = tongdao2[i+1];
        s3 = tongdao3[i+1];
        s4 = tongdao4[i+1];
        //qDebug()<< "s1::" << i+1 << s1.count() << s1;
        //把阈值和ct值取出来
                yuzhi.append(s1[0]);
                s1.removeFirst();
                ct.append(s1[0]);
                s1.removeFirst();

                yuzhi.append(s2[0]);
                s2.removeFirst();
                ct.append(s2[0]);
                s2.removeFirst();

                yuzhi.append(s3[0]);
                s3.removeFirst();
                ct.append(s3[0]);
                s3.removeFirst();

                yuzhi.append(s4[0]);
                s4.removeFirst();
                ct.append(s4[0]);
                s4.removeFirst();
        //内循环（测试循环数40）
        for (int j=0;j<s1.count();j++) {
//            qDebug()<<"i "<<i ;
//            qDebug()<<"j "<<j ;
            num = j % s1.count();
            kongwei.insert("1",QString::number(s1[j]));
            kongwei.insert("2",QString::number(s2[j]));
            kongwei.insert("3",QString::number(s3[j]));
            kongwei.insert("4",QString::number(s4[j]));
            platedata.append(kongwei);
//            qDebug()<<"platecount::"<<platedata.count()%s1.count();
            if(platedata.count()%s1.count() == 0){
                resdata.append(platedata);
                platedata.clear();
            }
            //qDebug()<<"platedata.count()::"<<platedata.count()<<platedata[0].count();
            }
        }
    int tmp=0;
//    qDebug()<<"yuzhi::"<<yuzhi.count()<<yuzhi;
//    qDebug()<<"ct::"<<ct.count()<<ct;
    for (int i=0;i<yuzhi.count();i++) {
//        qDebug()<<"ct[i]"<<yuzhi[i];
        //qDebug()<<"i%ct.count"<<(i+1)%4;
        tmp = i%4;
        if(tmp==0){
            yuzhidata.insert("1",QString::number(yuzhi[i]));
        }else if(tmp == 1){
            yuzhidata.insert("2",QString::number(yuzhi[i]));
        }else if(tmp == 2){
            yuzhidata.insert("3",QString::number(yuzhi[i]));
        }else if(tmp == 3){
            yuzhidata.insert("4",QString::number(yuzhi[i]));
            resyuzhi.append(yuzhidata);
            yuzhidata.clear();
        }
    }

    for (int i = 0;i<resdata[0].count();i++) {
        for (int j =0;j<resdata.count();j++) {
            p1.append(resdata[j][i]);
        }
        res.append(p1);
        p1.clear();
    }
    zuhedata={res, ct, resyuzhi};
    //qDebug()<<"res:"<<res.count()<<res[0].count();
    return  zuhedata;
}

///
/// \brief dataanalyse::PROCDataAnalyse 数据分析方法封装
/// \param data      原始荧光值
/// \param shuaijian 是否衰减 0-关，1-开
/// \param CtType    ct值计算方法 0-sigmoid，1-交叉，2-普通
/// \param start     baseline["start"]
/// \param end       baseline["end"]
/// \param yuzhi1    通道1阈值 double型 默认0.0
/// \param yuzhi2    通道2阈值 double型 默认0.0
/// \param yuzhi3    通道3阈值 double型 默认0.0
/// \param yuzhi4    通道4阈值 double型 默认0.0
/// \return        元组<数据分析后的荧光值，ct值（键值对能对应孔位）， 阈值>
///
std::tuple<QList<QList<QHash<QString, QString>>> ,QList<double>,QList<QHash<QString, QString>>> dataanalyse::PROCDataAnalyse(QList<QList<QHash<QString, QString>>> data, int shuaijian = 1,int CtType=0,QList<QHash<QString, int>> baseline = {}, double yuzhi1 = 0.0, double yuzhi2 = 0.0, double yuzhi3 = 0.0, double yuzhi4 = 0.0
        ,int shuaijianType=0, int lvboType=0, int NL=0, int sigmodType = 0){


//    qDebug() << "PROCdata" << data;

//    qDebug() << "PROCDataAnalyse" << yuzhi1 << yuzhi2 << yuzhi3 << yuzhi4;
//    qDebug() << "shuaijianType" << shuaijianType;
//    qDebug() << "lvboType" << lvboType;
    qDebug() << "sigmodType" << sigmodType;
//    qDebug() << "baseline" << baseline;

    //拆分荧光数据方法
    QList<QList<QHash<int, QHash<int, int>>>> chaifenres = PROCchaijie(data);

    //数据分析方法
    QList<QHash<int, QList<double>>> anares = PROCparseData(chaifenres,shuaijian,CtType,baseline, yuzhi1, yuzhi2, yuzhi3, yuzhi4, shuaijianType, lvboType, NL, sigmodType);

//    qDebug() << "sigmodType" << sigmodType;

    //返回最终需要的结果
    std::tuple<QList<QList<QHash<QString, QString>>> ,QList<double>,QList<QHash<QString, QString>>> resdata =PROCzuheData(anares);

    return resdata;
}
